package org.breathe;

import org.breathe.server.RedisServer;
import org.breathe.server.impl.MiniRedisServer;

import java.io.FileNotFoundException;

/**
 * redis server start class
 * @author: breathe
 * @createTime: 2025-05-12
 */
public class RedisServerLauncher {
    public static void main(String[] args) throws Exception {
        RedisServer redisServer = new MiniRedisServer("localhost", 6379);
        //set a hook to stop
        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
            try {
                redisServer.stop();
                Thread.sleep(500);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }));
        redisServer.start();
    }
}
